﻿using System.Linq;
using PortalCurriculo.Domain.Interface;

namespace PortalCurriculo.Domain
{
    public partial class Endereco : IEndereco
    {
        public Endereco Selecionar()
        {
            return (from endereco in Context.Instance.Enderecoes
                    where (endereco.Id.Equals(Id) || Id.Equals(0))
                          && (endereco.IdPessoa.Equals(IdPessoa) || IdPessoa.Equals(0))
                          && endereco.Ativo
                    select endereco).FirstOrDefault();
        }
    }
}
